﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace Wix.Aura.Common.CustomTypes {
	public struct FileType : IEquatable<FileType> {
		private FileType(FileValue value) {
			this.value = value;
		}

		private FileValue value;

		public override string ToString() {
			return value.ToString().ToLower(CultureInfo.InvariantCulture);
		}

		public static FileType Directory { get { return new FileType(FileValue.Directory); } }
		public static FileType File { get { return new FileType(FileValue.File); } }
		public static FileType Raw { get { return new FileType(FileValue.Raw); } }


		public bool Equals(FileType other) {
			return value.Equals(other.value);
		}

		public override bool Equals(object obj) {
			if (obj is FileType)
				Equals((FileType)obj);
			return false;
		}

		public override int GetHashCode() {
			int hash = 13;
			hash = 23 * hash + value.GetHashCode();
			return hash;
		}


		public static bool operator ==(FileType f1, FileType f2) {
			return f1.Equals(f2);
		}


		public static bool operator !=(FileType v1, FileType v2) {
			return !v1.Equals(v2);
		}
	}

	public enum FileValue {
		Directory,
		File,
		Raw
	}
}
